<!DOCTYPE html>
<html lang="en">

<head>
	<title>QA安全测试平台</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="description" content="Free landing page website template">
	<meta name="author" content="The Develovers">

	<!-- dataTables Styles-->
	<link href="assets/css/dataTables.bootstrap.css" rel="stylesheet"/>
	<!-- CORE CSS -->
	<link href="assets/css/bootstrap.css" rel="stylesheet" type="text/css">
	<!-- Custom Styles-->
	<link href="assets/css/custom-styles.css" rel="stylesheet" />
	<!-- THEME CSS -->
	<link href="assets/css/main.css" rel="stylesheet" type="text/css">
	<!-- FontAwesome Styles-->
	<link href="assets/css/font-awesome.css" rel="stylesheet" />
	<!-- dataTables Styles-->

	<!-- FAVICONS -->
	<link rel="shortcut icon" href="assets/ico/favicon.ico">
	<!-- JS Scripts-->
	<!-- jQuery Js -->
	<script src="assets/js/jquery-2.1.1.min.js"></script>
	<!-- Bootstrap Js -->
	<script src="assets/js/bootstrap.min.js"></script>
	<!-- Metis Menu Js -->
	<script src="assets/js/jquery.metisMenu.js"></script>
	<!-- Custom Js -->
	<script src="assets/js/custom-scripts.js"></script>

	<!-- JS Scripts-->
	<!-- jQuery Js -->
	<script src="assets/js/jquery-2.1.1.min.js"></script>
	<!-- Bootstrap Js -->
	<script src="assets/js/bootstrap.min.js"></script>

	<script src="https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script>
	<script src="https://cdn.datatables.net/1.10.15/js/dataTables.bootstrap.js"></script>

	<script type="text/javascript">
        //获取url参数
        function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg);  //匹配目标参数
            if (r != null) return unescape(r[2]);
            return null; //返回参数值
        }
        //获取url参数
        function getModuleName (name) {
            var moduleKey = [["security", "安全测试"],["performance", "性能测试"],["pcSecurity", "PC安全"],["androidSecurity", "Android安全"], ["pcPerformance", "PC性能"], ["androidPerformance", "Android性能"]]
            for (var i = 0; i < moduleKey.length; i++) {
                if(name == moduleKey[i][0]){
                    return moduleKey[i][1]
				}
            }
            return ""; //返回参数值
        }

        $(document).ready(function () {
            $("#nav").load("nav.html");
            var module = getUrlParam('module')
            var type = getUrlParam('type')

            $("#type").text(getModuleName(type))
            $("#module").text(getModuleName(module))

            console.log(module)
            console.log(type)
			 type = "#"+type
			 module = "#"+module
            $(module).attr("class","active-menu")
            $(type).attr("aria-expanded","true")
            $(type).attr("style","")
            $(type).attr("class","nav nav-second-level collapse in")



            $('#myTable').DataTable({
                "lengthChange": true,
                "ordering": false,
                "aaSorting": [[0, "asc"]], //默认的排序方式，第1列，升序排列
                "info": true,
                "destroy": true,
                "processing": true,
                "serverSide": true,
                "aLengthMenu": [10, 15, 20],
                "PaginationType": "full_numbers", //详细分页组，可以支持直接跳转到某页
                //当处理大数据时，延迟渲染数据，有效提高Datatables处理能力
                "deferRender": true,

                "searching": false,
                ajax: {
                    url: 'http://192.168.10.147:5000/reportList',
                    type: 'POST',
					data:{
                        "module":getModuleName(module)
					}
                },
                "language": {
                    "sProcessing": "处理中...",
                    "sLengthMenu": "每页显示 _MENU_ 条",
                    "sZeroRecords": "没有匹配结果",
                    "sInfo": "显示第 _START_ 至 _END_  条 结果，共 _TOTAL_  条",
                    "sInfoEmpty": "显示第 0 至 0  条 结果，共 0  条",
                    "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
                    "sInfoPostFix": "",
                    "sSearch": "搜索:",
                    "sUrl": "",
                    "sEmptyTable": "表中数据为空",
                    "sLoadingRecords": "载入中...",
                    "sInfoThousands": ",",
                    "oPaginate": {
                        "sFirst": "首页",
                        "sPrevious": "上页",
                        "sNext": "下页",
                        "sLast": "末页"
                    },
                },
                "columns": [
                    {"data": "title"},
                    {"data": "creat_time"},
                    {"data": "user_name"},
                    {"data": "testResult"},
                    {
                        "data": function (data) {
                            var html = "<a href='report.html?id=" + data.id + " ' target=\"_blank\">查看</a>"
                            return html;
                        }
                    }
                ]
            });

        });

	</script>
</head>
<body data-spy="scroll">

<!-- WRAPPER -->
<div id="wrapper">

	<!-- NAVBAR -->
	<nav id="main-navbar" class="navbar navbar-default navbar-fixed-top" style="background-color: #313131">
		<div class="container">
			<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-nav-collapse">
				<span class="sr-only">安全测试平台</span>
				<i class="fa fa-bars"></i>
			</button>
			<a href="index.html" class="navbar-brand">
				<img src="assets/img/logo1.png" alt="安全测试平台">
				<span style="color:#ffffff">安全测试平台</span>
			</a>
			<div id="main-nav-collapse" class="collapse navbar-collapse">
				<ul class="nav navbar-nav nav-onepage">
					<li class="active"><a href="./index.html">首页 </a></li>
					<li><a href="#security">安全测试 </a></li>
					<li><a href="#performance">性能测试 </a></li>
					<li><a href="#securityTools">安全工具测试 </a></li>
				</ul>
			</div>

		</div>
	</nav>
	<!-- END NAVBAR -->

	<nav class="navbar-default navbar-side" role="navigation">
		<div class="sidebar-collapse">
			<ul class="nav" id="main-menu">
				<li>
					<a href="#" ><i class="fa"><img src="assets/img/security.png" > </i>安全测试<span class="fa arrow"></span></a>
					<ul class="nav nav-second-level" id="security">
						<li>
							<a href="reportList.html?type=security&module=pcSecurity" id="pcSecurity"><i class="fa" ><img src="assets/img/PC2.png" ></i>PC安全</a>
						</li>
						<li>
							<a href="reportList.html?type=security&module=androidSecurity" id="androidSecurity"><i class="fa"><img src="assets/img/android2.png" ></i>Android安全</a>
						</li>
					</ul>
				</li>
				<li>
					<a href="#"><i class="fa"><img src="assets/img/performance.png" > </i> 性能测试<span class="fa arrow"></span></a>
					<ul class="nav nav-second-level"id="performance">
						<li>
							<a href="reportList.html?type=performance&module=pcPerformance" id="pcPerformance"><i class="fa"><img src="assets/img/PC3.png" ></i>PC性能</a>
						</li>
						<li>
							<a href="reportList.html?type=performance&module=androidPerformance" id="androidPerformance"><i class="fa"><img src="assets/img/android2.png" ></i>Android性能</a>
						</li>
					</ul>
				</li>
				<li>
					<a href="#"><i class="fa fa-qrcode"></i> 预留菜单</a>
				</li>

				<li>
					<a href="#"><i class="fa fa-table"></i> 预留菜单</a>
				</li>
				<li>
					<a href="#"><i class="fa fa-edit"></i> 预留菜单 </a>
				</li>

			</ul>
		</div>

	</nav>

	<div id="page-wrapper">
		<div class="header">
			<h1 class="page-header">
				<small>安全测试报告</small>
			</h1>
			<ol class="breadcrumb">
				<li><a href="#" id="type"></a></li>
				<li class="active" id="module"></li>
			</ol>

		</div>
		<div id="page-inner">
			<div class="row">
				<div class="col-md-12">
					<!-- Advanced Tables -->
					<div class="panel panel-default">
						<!--<div class="panel-heading">-->
						<!--Advanced Tables-->
						<!--</div>-->
						<div class="panel-body">
							<div class="table-responsive">
								<table class="table table-striped table-bordered table-hover" id="myTable">
									<thead>
									<tr>
										<th style="min-width: 40%">标题</th>
										<th style="min-width: 25%">创建时间</th>
										<th style="min-width: 10%">创建者</th>
										<th style="min-width: 10%">测试结果</th>
										<th style="min-width: 10%">操作</th>
									</tr>
									</thead>
								</table>
							</div>

						</div>
					</div>
					<!--End Advanced Tables -->
				</div>
			</div>
		</div>

	</div>
</div>
<!-- END WRAPPER -->


</body>

</html>
